<%--
 *  File:    BeforeVisitPlanFrm.jsp
 *  @Author: jackwang
 *  Date:    2013/05/4
 *
 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/oval-tag.tld" prefix="oval"%>
<%@ taglib uri="/WEB-INF/custom-tag.tld" prefix="custom"%>

<% //--------------------------------------  setting logger --%>

<%
  Category cat = Category.getInstance("jsp.BeforeVisitPlanFrm"); 
  //init param
  String privilegeCode = "H0259,H0260";
  String strModuleName = "CRM";
  String pageName = "p_beforevisitplanfrm";
%>
<%@ include file="/inc/Security.inc"%>
<%@ include file="/inc/PageDefault.inc"%>
<%@ include file="/inc/InitEdit.inc"%>
<%@ include file="/inc/FrmDefault.inc"%>
<html>
<head>
<title>BeforeVisitPlanFrm</title>
<PageFlow:CheckPageFlow pageName="p_beforevisitplanfrm" />
<%  


StringBuffer strParams=new StringBuffer();
if(request.getParameter("year")!=null)
{
	strParams.append("&year=").append(request.getParameter("year"));
}else{
	strParams.append("&year=").append(pageContext.getAttribute("year"));
}
if(request.getParameter("monthofyear")!=null)
{
	strParams.append("&monthofyear=").append(request.getParameter("monthofyear"));
}else{
	strParams.append("&monthofyear=").append(pageContext.getAttribute("monthofyear"));
} 
if(request.getParameter("weekofmonth")!=null)
{
	 strParams.append("&weekofmonth=").append(request.getParameter("weekofmonth"));
}else{
	strParams.append("&weekofmonth=").append(pageContext.getAttribute("weekofmonth"));
} 
if(request.getParameter("dayofmonth")!=null)
{
	 strParams.append("&dayofmonth=").append(request.getParameter("dayofmonth"));
}else{
	strParams.append("&dayofmonth=").append(pageContext.getAttribute("dayofmonth"));
} 
if(request.getParameter("dayofweek")!=null)
{
	 strParams.append("&dayofweek=").append(request.getParameter("dayofweek"));
} else{
	strParams.append("&dayofweek=").append(pageContext.getAttribute("dayofweek"));
}
if(request.getParameter("customerid")!=null)
{
	 strParams.append("&customerid=").append(request.getParameter("customerid"));
} else{
	strParams.append("&customerid=").append(pageContext.getAttribute("customerid"));
}
if(request.getParameter("processid")!=null)
{
	 strParams.append("&processid=").append(request.getParameter("processid"));
} else{
	strParams.append("&processid=").append(pageContext.getAttribute("processid"));
}
if(request.getParameter("uprocessid")!=null)
{
	 strParams.append("&uprocessid=").append(request.getParameter("uprocessid"));
} else{
	strParams.append("&uprocessid=").append(pageContext.getAttribute("uprocessid"));
}
if(request.getParameter("contactid")!=null)
{
	 strParams.append("&contactid=").append(request.getParameter("contactid"));
}else{
	strParams.append("&contactid=").append(pageContext.getAttribute("contactid"));
}
if(request.getParameter("globalpccode")!=null)
{
	 strParams.append("&globalpccode=").append(request.getParameter("globalpccode"));
}else{
	strParams.append("&globalpccode=").append(pageContext.getAttribute("globalpccode"));
}
if(request.getParameter("vflag")!=null)
{
	 strParams.append("&vflag=").append(request.getParameter("vflag"));
}else{
	strParams.append("&vflag=").append(pageContext.getAttribute("vflag"));
}
 strParams.append("&orgid=").append(1);
 
 
    String strIsDefault = (String)pageContext.getAttribute("isdefault");
	if("Y".equals(pageContext.getAttribute("isdefault"))) {
		strIsDefault = "&isdefault=Y";
	}else if ("N".equals(pageContext.getAttribute("isdefault"))) {
		strIsDefault = "&isdefault=N";
	}else  {
		strIsDefault = null;
	}
	
	String processid=null;
	if(request.getParameter("processid")!=null)
	{
		processid=(String)request.getParameter("processid");
	} else{
		processid=((Integer)pageContext.getAttribute("processid")).toString();
	}
    String isNew = (String)pageContext.getAttribute("isNew");
	if("Y".equals((String)pageContext.getAttribute("isNew"))) {
		isNew = "&isNew=Y";
	}else if ("N".equals((String)pageContext.getAttribute("isNew"))) {
		isNew = "&isNew=N";
	}else  {
		isNew = null;
	}
	String isdetail = (String)pageContext.getAttribute("isdetail");
	String strurl = null;
	if("Y".equals((String)pageContext.getAttribute("isdetail"))) {
		//strurl = "VisitProcessDetailEdit.jsp?"+OvalTools.randomURL()+"&languagecode="+JspHelper.filterNull( strFrmLanguageCode )+JspHelper.filterNull( visitprocessid)+JspHelper.filterNull( strIsDefault)+JspHelper.filterNull(isNew);
	}else{
		if(processid != null && processid.length() != 0 && !(("null").equals(processid))){
			strurl = "BeforeVisitPlanMain.jsp?"+OvalTools.randomURL()+ "&languagecode="+JspHelper.filterNull( strFrmLanguageCode )+JspHelper.filterNull( strIsDefault)+JspHelper.filterNull(isNew)+strParams.toString();
		}else{
			strurl = "BeforeVisitPlanFeedbackDetail114.jsp?"+OvalTools.randomURL()+ "&languagecode="+JspHelper.filterNull( strFrmLanguageCode )+JspHelper.filterNull( strIsDefault)+JspHelper.filterNull(isNew)+strParams.toString();	
		}
	}
	

	//System.out.print("strParams="+strParams);
	
%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<frameset rows="54,*" frameborder="YES" border="0" framespacing="0"
	cols="*" bordercolor="#999999">
	<frame name="up"
		src="BeforeVisitPlanHeaderEdit.jsp?<%= OvalTools.randomURL() %>&languagecode=<%=JspHelper.filterNull( strFrmLanguageCode )%><%=JspHelper.filterNull( strIsDefault)%><%=strParams.toString()%>"
		frameborder="NO" scrolling="NO">
	<frame name="down" src="<%=JspHelper.filterNull( strurl)%>"
		scrolling="yes" frameborder="NO" noresize>
</frameset>
<noframes>
<body>
</body>
</noframes>
</html>


